//
//  HELHistoryCheckVC.m
//  NursingAssociation
//
//  Created by wsj2015 on 2017/3/27.
//  Copyright © 2017年 wsj2015. All rights reserved.
//

#import "HELHistoryCheckVC.h"
#import "HELCreditRecordListVC.h"
#import "HELCreditStatisticsVC.h"
@interface HELHistoryCheckVC ()


@property (nonatomic,  strong) NSArray *types;
@end

@implementation HELHistoryCheckVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self addLine];
    self.title  =@"历年学分";
}
- (NSArray *)types{
    if (!_types) {
        _types = @[@"申请记录",@"历年统计"];
    }
    return _types;
}

- (instancetype)init {
    if (self = [super init]) {
        self.titleSizeNormal = 17;
        self.titleSizeSelected = 17;
        self.menuViewStyle = WMMenuViewStyleLine;
        self.menuItemWidth = [UIScreen mainScreen].bounds.size.width / self.types.count;
        self.menuHeight = 49;
        self.menuView.speedFactor = 3;
        self.title = @"我的课程";
        self.menuBGColor = [UIColor whiteColor];
        self.titleColorSelected =kMainColor;
        self.titleColorNormal =[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0];
    }
    return self;
}
- (void)addLine{
    UIView *line = [UIView new];
    line.backgroundColor = kBorderColor;
    line.frame = CGRectMake(0, 48, kScreenWidth, 1);
    [self.menuView insertSubview:line atIndex:0];
    
}

#pragma mark - Datasource & Delegate
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return self.types.count;
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    
    if (index == 0) {
    
      HELCreditRecordListVC *vc =  [HELCreditRecordListVC new];
    return vc;
    }else{
      HELCreditStatisticsVC *vc =  [HELCreditStatisticsVC new];
           return vc;
    }
    
  
   
 
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return self.types[index];
}
- (void)pageController:(WMPageController *)pageController willEnterViewController:(__kindof UIViewController *)viewController withInfo:(NSDictionary *)info{
    
    id vc = viewController;
  
    [vc requestDataFirst];
    
}

@end
